package experiment1.closestpoints;

public class ClosestPoints1 extends ClosestPoints{

    //暴力，直接穷举每个点之间的距离
    @Override
    public double solve(Point[]points,int l, int r){
        double mid_dis = Double.MAX_VALUE;
        for (int i = l; i <= r - 1; i++) {
            for (int j = i + 1; j <= r; j++) {
                mid_dis = Math.min(mid_dis , points[i].distance(points[j]));
            }
        }

        return mid_dis;
    }
}
